home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Kit PC World De Ampliacion De Windows 95
/
Kit PC World de ampliacion de Windows 95.iso
/
internet
/
sweeper
/
samples
/
olecon~1
/
controls
/
template
/
autotmpl.cpp
< prev
next >
Wrap
Text File
|
1995-11-25
|
4KB
|
132 lines
//=--------------------------------------------------------------------------=
// <<DEFOBJECTTRUNCNAME>>Obj.Cpp
//=--------------------------------------------------------------------------=
// Copyright 1995 Microsoft Corporation. All Rights Reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//=--------------------------------------------------------------------------=
//
// the <<DEFOBJECTNAME>> object
//
//
#include "IPServer.H"
#include "LocalObj.H"
#include "<<DEFOBJECTNAME>>Obj.H"
// for ASSERT and FAIL
//
SZTHISFILE
//=--------------------------------------------------------------------------=
// C<<DEFOBJECTNAME>>::Create
//=--------------------------------------------------------------------------=
// creates a new <<DEFOBJECTNAME>> object.
//
// Parameters:
// IUnknown * - [in] controlling unkonwn
//
// Output:
// IUnknown * - new object.
//
// Notes:
//
IUnknown *C<<DEFOBJECTNAME>>::Create
(
IUnknown *pUnkOuter
)
{
// make sure we return the private unknown so that we support aggegation
// correctly!
//
C<<DEFOBJECTNAME>> *pNew = new C<<DEFOBJECTNAME>>(pUnkOuter);
return pNew->PrivateUnknown();
}
//=--------------------------------------------------------------------------=
// C<<DEFOBJECTNAME>>::C<<DEFOBJECTNAME>>
//=--------------------------------------------------------------------------=
// create the object and initialize the refcount
//
// Parameters:
// IUnknown * - [in] controlling unknown
//
// Notes:
//
#pragma warning(disable:4355) // using 'this' in constructor
C<<DEFOBJECTNAME>>::C<<DEFOBJECTNAME>>
(
IUnknown *pUnkOuter
)
: CAutomationObject(pUnkOuter, OBJECT_TYPE_OBJ<<DEFOBJECTNAMECAPS>>, (void *)this)
{
// TODO: initialize anything here
}
#pragma warning(default:4355) // using 'this' in constructor
//=--------------------------------------------------------------------------=
// C<<DEFOBJECTNAME>>::C<<DEFOBJECTNAME>>
//=--------------------------------------------------------------------------=
// "We all labour against our own cure, for death is the cure of all diseases"
// - Sir Thomas Browne (1605 - 82)
//
// Notes:
//
C<<DEFOBJECTNAME>>::~C<<DEFOBJECTNAME>> ()
{
// TODO: clean up anything here.
}
//=--------------------------------------------------------------------------=
// C<<DEFOBJECTNAME>>::InternalQueryInterface
//=--------------------------------------------------------------------------=
// the controlling unknown will call this for us in the case where they're
// looking for a specific interface.
//
// Parameters:
// REFIID - [in] interface they want
// void ** - [out] where they want to put the resulting object ptr.
//
// Output:
// HRESULT - S_OK, E_NOINTERFACE
//
// Notes:
//
HRESULT C<<DEFOBJECTNAME>>::InternalQueryInterface
(
REFIID riid,
void **ppvObjOut
)
{
CHECK_POINTER(ppvObjOut);
// we support I<<DEFOBJECTNAME>> and ISupportErrorInfo
//
if (DO_GUIDS_MATCH(riid, IID_I<<DEFOBJECTNAME>>)) {
*ppvObjOut = (void *)(I<<DEFOBJECTNAME>> *)this;
AddRef();
return S_OK;
} else if (DO_GUIDS_MATCH(riid, IID_ISupportErrorInfo)) {
*ppvObjOut = (void *)(ISupportErrorInfo *)this;
AddRef();
return S_OK;
}
// call the super-class version and see if it can oblige.
//
return CAutomationObject::InternalQueryInterface(riid, ppvObjOut);
}
// TODO: implement your interface methods and property exchange functions
// here.